<template>
  <div class="app-container">
    <div class="row">
      <!-- <div class="f-a-c">
        <div class="lable">瞬时流量临界值:</div>
        <el-input v-model="form.ssllcriticality" placeholder="默认10000"></el-input>
      </div> -->
      <div class="f-a-c">
        <div class="lable">累计流量临界值:</div>
        <el-input v-model="form.ljllcriticality" placeholder="默认10000"></el-input>
      </div>
      <div class="f-a-c">
        <div class="lable">瞬时热量临界值:</div>
        <el-input v-model="form.ssrlcriticality" placeholder="默认10000"></el-input>
      </div>
      <div class="f-a-c">
        <div class="lable">累计热量临界值:</div>
        <el-input v-model="form.ljrlcriticality" placeholder="默认10000"></el-input>
      </div>
      <div class="f-a-c">
        <div class="lable">热量单位:</div>
        <el-select v-model="form.heatunit" placeholder="请选择">
          <el-option label="焦耳" value="J"></el-option>
          <el-option label="瓦特" value="W"></el-option>
        </el-select>
      </div>
    </div>
    <div class="foot">
      <el-button size="medium" type="primary" @click="submit">确 定</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      form: {
        ssllcriticality: "10000",
        ljllcriticality: "10000",
        ssrlcriticality: "10000",
        ljrlcriticality: "10000",
        heatunit: "W",
      },
    };
  },
  created() {
    if (localStorage.getItem("unitOption")) {
      this.form = JSON.parse(localStorage.getItem("unitOption"));
    }
  },
  methods: {
    submit() {
      let unitOption = JSON.stringify(this.form);
      localStorage.setItem("unitOption", unitOption);
      this.$message({
        message: "设置成功",
        type: "success",
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.row {
  display: flex;
  gap: 0 20px;
}
.f-a-c {
    // display: flex;
//   align-items: center;

  .lable {
    font-size: 14px;
    min-width: 80px;
    margin-bottom: 12px;
    white-space: nowrap;
    vertical-align: middle;
    color: #fff;
  }
}
.foot {
  position: relative;
  top: 100px;
}
</style>
